<template>
  <div class="container">
    <div class="head">个人信息</div>
    <div class="listWrap">
      <ul>
        <li>
          乙方：
          <span>{{ order_info.water.user_name}}</span>
        </li>
        <li>
          手机号：
          <span>{{ order_info.water.user_phone }}</span>
        </li>
        <li>
          证件号：
          <span>{{ order_info.water.user_identify }}</span>
        </li>
      </ul>
    </div>
    <div class="head">奖励细则</div>
    <div class="listWrap">
      <ul>
        <li>
          消费医院：
          <span>{{ order_info.water.hospital_name }}</span>
        </li>
        <li>
          消费时间：
          <span>{{ order_info.water.order_time }}</span>
        </li>
        <li>
          消费总金额：
          <span>¥{{ order_info.total_money }}</span>
        </li>
        <li class="grey">
          大写：
          <span>{{order_info.total_money_dx}}</span>
        </li>
        <li>
          扣除杂费金额：
          <span>¥{{ order_info.money}}</span>
        </li>
        <li class="grey">
          大写：
          <span>{{ order_info.money_dx}}</span>
        </li>
        <li>
          可提现积分：
          <span>{{ order_info.cash_allowance }}</span>
        </li>
        <li>
          不可提现积分：
          <span>{{ order_info.integral_allowance }}</span>
        </li>
        <li>
          乙方手术时间：
          <span>{{ order_info.operation_time }}</span>
        </li>
      </ul>
    </div>
    <button class="share" @click="showToas">发送给客户确认签字</button>
  </div>
</template>
<script>
import { Toast } from "mint-ui";
import  api from '../../assets/js/api'
export default {
  data() {
    return {
      order_info: {
        water: {
          hospital_name: "",
          id: -99,
          order_time: "",
          user_identify: "",
          user_name: "",
          user_phone: ""
        },
        cash_allowance: 500,
        cash_allowance_dx: "伍佰",
        integral_allowance: 490,
        integral_allowance_dx: "肆佰玖拾",
        money: 1000,
        money_dx: "壹仟圆整",
        operation_time: "2019-06-21",
        order_id: 181,
        other_money: -1000,
        other_money_dx: "负壹仟圆整",
        total_money: 0,
        total_money_dx: "零圆整",
        liuhsui_id: ""
      }
    };
  },
  mounted() {
    this.axios.defaults.baseURL = api
    let order_id = this.$route.params.order_id;
    let id = this.$route.params.id;
    let liuhsui_id = this.$route.params.order_id;
    this.liuhsui_id = liuhsui_id;
    console.log(this.$route.params);
    // return;
    this.axios
      .post("/api/butler/ht/info", { id })
      .then(res => {
        if (res.status == 200) {
          res.data.data.water.order_time = res.data.data.water.order_time
            .replace("年", "-")
            .replace("月", "-")
            .replace("日", "");
          res.data.data.operation_time = res.data.data.operation_time
            .replace("年", "-")
            .replace("月", "-")
            .replace("日", "");
          this.order_info = res.data.data;
          console.log(this.order_info);
        }
      })
      .catch(res => {});
  },
  methods: {
    showToas() {
      //  这里发送数据 请求 提交数据
      let id = this.$route.params.id;
      this.axios
        .post("/api/butler/ht/send", { id })
        .then(res => {
          console.log(res);
          if (res.status == 200 && res.data.code == 200) {
            // 提交成功
            Toast("提交成功");
            this.$router.go(-1);
            setTimeout(() => {
              window.location.reload();
            }, 500);
          } else {
            Toast(res.data.msg);
          }
        })
        .catch(res => {});
    }
  }
};
</script>

<style scoped>
.head {
  height: 44px;
  line-height: 44px;
  background: rgba(247, 247, 247, 1);
  font-size: 14px;
  color: rgba(120, 130, 140, 1);
  padding: 0 15px;
}
.listWrap {
  padding: 0 15px;
}
.listWrap li {
  height: 50px;
  line-height: 50px;
  border-bottom: 1px solid rgba(204, 204, 204, 0.3);
  color: #666;
  font-weight: 600;
}
.listWrap li span {
  color: #888;
}
.listWrap li:nth-last-child(1) {
  border-bottom: none;
}
.listWrap li.grey {
  color: #969696;
}
.share {
  display: block;
  margin: 20px auto;
  font-size: 17px;
  letter-spacing: 1px;
}
</style>
